<template>
	<view>
		<van-tabs color="#1989fa" title-active-color="#1989fa" animated swipeable @click="switchTab">
			<van-tab title="待办" name="db">
				<list1 ref="list1" :swType="swType1" :finishStatus="finish1" :key='1'></list1>
			</van-tab>
			<van-tab title="领导批示收文" name="ldps">
				<list3 ref="list3" :swType="swType3" :finishStatus="finish3" :key='3'></list3>
			</van-tab>
			<van-tab title="未批示收文" name="wps">
				<list2 ref="list2" :swType="swType2" :finishStatus="finish2" :key='2'></list2>
			</van-tab>
			<van-tab title="所有收文" name="all">
				<list4 ref="list4" :swType="swType4" :finishStatus="finish4" :key='4'></list4>
			</van-tab>
		</van-tabs>
	</view>
</template>

<script>
	import list1 from 'pages/admin/components/receiveDoc/compo-list';
	import list2 from 'pages/admin/components/receiveDoc/compo-list';
	import list3 from 'pages/admin/components/receiveDoc/compo-list';
	import list4 from 'pages/admin/components/receiveDoc/compo-list';
	
	export default {
		components:{
			list1,
			list2,
			list3,
			list4,
		},
		
		data() {
			return {
				swType1: '1', 		// 默认展开待办列表
				swType2: '2',
				swType3: '3',
				swType4: '',
				finish1: false,   // 除待办外，其他默认没有更多
				finish2: true,
				finish3: true,
				finish4: true,
			}
		},
		methods: {
			switchTab(name) {
				// 待办列表
				if(name == 'db') {
					this.swType1 = '1'
					this.finish1 = false
					this.finish2 = true
					this.finish3 = true
					this.finish4 = true
				}
				// 未批示收文
				if(name == 'wps') {
					console.log('-------------do-wps');
					this.swType2 = '2'
					this.finish2 = false
					this.finish1 = true
					this.finish3 = true
					this.finish4 = true
				}
				// 领导批示
				if(name == 'ldps') {
					console.log('-------------do-ldps');
					this.swType3 = '3'
					this.finish3 = false
					this.finish1 = true
					this.finish2 = true
					this.finish4 = true
				}
				// 全部收文
				if(name == 'all') {
					console.log('-------------do-all');
					this.swType4 = ''
					this.finish4 = false
					this.finish1 = true
					this.finish2 = true
					this.finish3 = true
				}
			}
		}
	}
</script>

<style>

</style>
